package com.ph.seata.storage.service;

import com.ph.seata.storage.dto.CommodityDTO;
import com.ph.seata.storage.model.StorageDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ph.web.common.response.WrapperResponse;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author swallow
 * @since 2021-06-29
 */
public interface StorageService extends IService<StorageDO> {


    WrapperResponse<Object> decreaseStorage(CommodityDTO commodityDTO);

    WrapperResponse<StorageDO> loadObject(CommodityDTO commodityDTO);

    WrapperResponse<StorageDO> loadObjectAndGlobalLock(CommodityDTO commodityDTO);

    WrapperResponse<StorageDO> loadObjectAndGlobalTransactional(CommodityDTO commodityDTO);

    WrapperResponse<StorageDO> loadObjectForUpdate(CommodityDTO commodityDTO);

    WrapperResponse<StorageDO> loadObjectAndGlobalLockForUpdate(CommodityDTO commodityDTO);

    WrapperResponse<StorageDO> loadObjectAndGlobalTransactionalForUpdate(CommodityDTO commodityDTO);
}
